<#include "../common/header.htm">
<div class="content-wrapper">
	<section class="content">
		<form action="${ctx}/datalog/list" method="get" id="listForm">
			<div class="box">
				<div class="box-header">
					<div class="row RowSearchWork">
						<div class="col-sm-12">
							<div class="form-group">
								<div class="form-inline">
									<div class="form-group">
										<label>模块标识</label>
										<select class="form-control" name="moduleFlag" style="display: inline-block;width: 120px;">
											<option value="-1">全部</option>
											<#list moduleFlags as mf>
												<#if mf.ordinal() != 11 && mf.ordinal() != 17>
												<option value="${mf.ordinal()}" <#if paramsDataLog.moduleFlag?? && paramsDataLog.moduleFlag == mf.ordinal()>selected</#if> >${mf.getName()}</option>
												</#if>
											</#list>
										</select>
									</div>
									<div class="form-group ml10">
										<label>数据ID</label>
										<input type="number" class="form-control" name="beanId" value="${paramsDataLog.beanId!}" placeholder="请输入数据ID" />
									</div>
									<div class="form-group ml10">
										<label>操作人</label>
										<input type="text" class="form-control" name="createUserName" value="${paramsDataLog.createUserName!}" placeholder="请输入操作人" />
									</div>
									<div class="form-group ml10">
										<label>操作时间</label>
										<div class="input-group">
											<input type="text" class="form-control pull-right" name="beginCreateTimeStr" value="${paramsDataLog.beginCreateTimeStr!}" id="starTime" autocomplete="off" placeholder="请输入发起时间" >
											<div class="input-group-addon">
												<span>至</span>
											</div>
											<input type="text" class="form-control pull-right" name="endCreateTimeStr" value="${paramsDataLog.endCreateTimeStr!}" id="endTime" autocomplete="off" placeholder="请输入结束时间" >
										</div>
									</div>
									<div class="form-group ml10">
										<label>操作类型</label>
										<select class="form-control" name="actionType" style="display: inline-block;width: 120px;">
											<option value="-1">全部</option>
											<#list actionTypes as at>
											<#if at.ordinal() != 4>
											<option value="${at.ordinal()}" <#if paramsDataLog.actionType?? && paramsDataLog.actionType == at.ordinal()>selected</#if> >${at.getName()}</option>
											</#if>
										</#list>
										</select>
									</div>
									<div class="form-group bill-buttonarea" >
										<input type="button" class="btn btn-primary" onclick="datalog.query();" value="查询" />
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="box-body">
					<table class="table table-hover table-bordered table-striped">
						<thead>
							<tr>
								<th style="width:3%;">#</th>
								<th style="width:10%;">系统</th>
								<th style="width:10%;">模块标识</th>
								<th style="width:40%;">数据ID</th>
								<th style="width:7%;">操作人</th>
								<th style="width:15%;">操作时间</th>
								<th style="width:7%;">操作类型</th>
								<th style="width:10%;" >操作</th>
							</tr>
						</thead>
						<tbody>
							<#list page.content as u>
								<tr>
									<td>${page.size * page.number+u_index+1}</td>
									<td>${u.systemFlag.getName()!}</td>
									<td>
										<#if moduleFlagMap?? && moduleFlagMap['${u.logId}']??>
											${moduleFlagMap['${u.logId}']}
										</#if>
									</td>
									<td class="_overFlowBeanId" title="${u.beanId!}">${u.beanId!}</td>
									<td>${u.createUserName!}</td>
									<td>${u.createTime?string("yyyy-MM-dd HH:mm:ss")}</td>
									<td>${u.actionType.getName()!}</td>
									<td><a href="${ctx}/datalog/dataDetailLog?parentLogId=${u.logId}">日志详情</a></td>
								</tr>
							</#list>
						</tbody>
					</table>
					<#include "../common/page.htm">
				</div>
			</div>
		</form>
	</section>
</div>
<script type="text/javascript">
	/* 日期选择器start */
	$('#starTime').datetimepicker({
	    format: 'yyyy-mm-dd hh:ii',
		language : 'zh-CN',
		autoclose: true,
		todayBtn: true,
		clearBtn : true,
		todayHighlight : true
	}).on('changeDate',function(ev){
	        var starttime=$("#starTime").val();
	        $("#endTime").datetimepicker('setStartDate',starttime);
	        $("#starTime").datetimepicker('hide');
	    });
	$('#endTime').datetimepicker({
	    format: 'yyyy-mm-dd hh:ii',
		language : 'zh-CN',
		autoclose: true,
		todayBtn: true,
		clearBtn : true,
		todayHighlight : true
	}).on('changeDate',function(ev){
		if (ev.date) {
			var endtime=$("#endtime").val();
			$("#starTime").datetimepicker('setEndDate',endtime);
		} else {
			$("#starTime").datetimepicker('setEndDate', new Date());
		}
	    });
	/* 日期选择器end */
	$(function () {
		$(".page-link").click(function () {
            $("form").submit();
        })
		$("#_changePageNumber").blur(function () {
            $("form").submit();
        })
    })
	var datalog = {
		query: function () {
			$(":input[name='pageNumber']").val(0);
			$("form").submit();
		}
	}
</script>
<style>
	.table{
		margin-bottom: 0;
	}
	.box-body {
		padding-left: 20px;
		padding-right: 10px;
	}
	input.form-control {
		width: 120px!important;
	}
	input#starTime {
		width: 120px;
	}
	input#endTime {
		width: 120px;
	}
	.box-header .row label {
		height: 30px;
		line-height: 24px;
	}
	.box-header {
		margin-bottom: 0;
		margin-top: 10px;
	}
	label {
		font-size: 13px;
		font-weight: 400;
		color: #6F7689;
	}
	.form-group {
		margin-left: 10px;
		margin-right: 15px;
	}
	.form-control{
		border-radius:4px;
		font-size: 12px;
	}
	.input-group .input-group-addon {
		border-color: transparent;
	}
	.input-group-addon span {
		font-size: 12px;
		color: #6F7689;
	}
	input.btn.btn-primary{
		width: 70px;
		height: 32px;
		margin-bottom: -7px;
	}
	.form-control:focus {
		border-color:#4595ec;
	}
	.form-control:hover{
		border-color:#4595ec;
	}
	.btn-primary{
		background-color:#4595ec;
		border-color:#4595ec;
	}
	.btn-primary:hover, .btn-primary:active, .btn-primary.hover{
		background-color:#61a8f5;
		border-color:#61a8f5;
	}
	.btn-primary.focus, .btn-primary:focus{
		background-color:#4595ec;
		border-color:#4595ec;
	}
	._overFlowBeanId{
		word-break:keep-all;
		white-space:nowrap;
		overflow:hidden;
		text-overflow:ellipsis;
	}
</style>